﻿
namespace CommonServiceLocator.Plugins
{
    using System;
    using System.Collections.Generic;

    using Microsoft.Practices.ServiceLocation;

    public class PluginsServiceLocator<T> : ServiceLocatorImplBase
    {
        private T provider;

        public PluginsServiceLocator(T provider)
        {
            this.provider = provider;
        }

        protected override object DoGetInstance(Type serviceType, string key)
        {
            if (key == null)
            {
                //...
            }

            //...

            throw new ActivationException(/*string.Format(Strings.CannotLocateInstancesOfContract, key)*/);
        }

        protected override IEnumerable<object> DoGetAllInstances(Type serviceType)
        {
            IEnumerable<object> exports = null; //..
            return exports;
        }
    }
}
